Skip to content

test: use ERM to destroy sqlite database handles after tests#63076

Open
Renegade334 wants to merge 1 commit intonodejs:mainfrom
Renegade334:test-sqlite-destroy-database-handles
Open

test: use ERM to destroy sqlite database handles after tests#63076
Renegade334 wants to merge 1 commit intonodejs:mainfrom
Renegade334:test-sqlite-destroy-database-handles

Conversation

@Renegade334
Copy link
Copy Markdown
Member

Some of the tests in test-sqlite-database-sync were using test runner "after" hooks to close down database handles on test completion, but not all. This appears to have caused a timing issue on some of the Windows runners where the process.on('exit') handler can be attempting to clean up the tempdir while sqlite3 still has active locks on the database files.

We could just add those same hooks to all the remaining tests, but we may as well use the language feature designed for this purpose!

Drive-by: we had two DatabaseSync tests in a separate file with duplicated test machinery, so folded these into the main test file.

Refs: #63052

Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/sqlite

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels May 1, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.63%. Comparing base (5e61a07) to head (29b58ed).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63076      +/-   ##
==========================================
- Coverage   89.65%   89.63%   -0.02%     
==========================================
  Files         712      712              
  Lines      220498   220498              
  Branches    42278    42276       -2     
==========================================
- Hits       197683   197651      -32     
- Misses      14663    14705      +42     
+ Partials     8152     8142      -10     

see 36 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@atlowChemi atlowChemi added the request-ci Add this label to start a Jenkins CI on a PR. label May 3, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 3, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

});
});

suite('DatabaseSync.prototype[Symbol.dispose]', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Should be a straightforward conflict to resolve in either direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants